package cn.wolfcode.trip.base.service.impl;


import cn.wolfcode.trip.base.domain.IntegralStore;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.mapper.IntegralStoreMapper;
import cn.wolfcode.trip.base.mapper.UserMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IIntegralStoreService;
import cn.wolfcode.trip.base.service.IUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class IntegralStoreServiceImpl implements IIntegralStoreService {
    @Autowired
    private IntegralStoreMapper integralStoreMapper;


    @Override
    public PageInfo query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<IntegralStore> list = integralStoreMapper.queryForList(qo);
        return new PageInfo<IntegralStore>(list);
    }

    @Override
    public IntegralStore selectOne(Long id) {
        return integralStoreMapper.selectOne(id);
    }

    @Override
    public void insertRelation(Long userId, Long productId) {
        integralStoreMapper.insertRelation(userId,productId);
    }

}
